{extend name="_container/table"}

{block name="left"}
{if check_access('add')}
<span class="layui-btn iframe" data-href="{:url('add')}" data-title="添加角色" data-width="80%" data-height="80%">添加角色</span>
{/if}
{/block}

{block name="right"}

{/block}

{block name="table_header"}
<tr>
  <th>id</th>
  <th>角色名</th>
  <th>权限</th>
  <th>操作</th>
</tr>
{/block}

{block name="table_body"}
<tr>
  <td>{$v.id}</td>
  <td>{$v.name}</td>
  <td>
    {foreach $v.adminAccess as $access}
      <span class="layui-badge">{$access['name']}</span>
    {/foreach}
  </td>
  <td>
    {if check_access('update')}
    <span class="layui-btn layui-btn-sm iframe" data-href="{:url('update', ['id'=>$v.id])}" data-title="编辑角色" data-height="80%" data-width="80%"  >编辑</span>
    {/if}
    {if check_access('delete')}
    <span data-href="{:url('delete', ['id'=>$v.id])}" class="layui-btn layui-btn-sm layui-btn-danger ajax_del" >删除</span>
    {/if}
  </td>
</tr>
{/block}

{block name="table_footer"}

{/block}

{block name="js"}

{/block}

{/extend}